package com.chii.color.client;

import com.chii.color.client.impl.ImageClientFallback;
import com.chii.color.config.FeignMultipartSupportConfig;
import com.chii.color.po.ResponeInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

@FeignClient(value = "sc-image", fallback = ImageClientFallback.class, configuration = FeignMultipartSupportConfig.class)
public interface ImageClient {

    @RequestMapping(value = "/updateImage", method = RequestMethod.POST, consumes = "multipart/form-data")
    ResponeInfo<String> updateImage(@RequestPart("file") MultipartFile file, @RequestParam("fileName") String fileName, @RequestParam("type") String type);


    @RequestMapping(value = "updateBase64Image", method = RequestMethod.POST)
    ResponeInfo<String> updateBase64Image(@RequestParam("base64") String base64, @RequestParam("fileName") String fileName, @RequestParam("type") String type);

}
